﻿@model BrnMall.Web.Models.ProductReviewListModel
@{
    Layout = null;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>@Model.ProductInfo.Name-评价列表-@{@WorkContext.MallConfig.SiteTitle}</title>
    @Html.Raw(WorkContext.MallConfig.SEOKeyword)
    @Html.Raw(WorkContext.MallConfig.SEODescription)
    <link href="@{@WorkContext.CSSCDN}/css/base.css" rel="stylesheet" type="text/css" />
    <link href="@{@WorkContext.CSSCDN}/css/content.css" rel="stylesheet" type="text/css" />
    <script src="@{@WorkContext.ScriptCDN}/scripts/utils.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/scripts/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        uid = @WorkContext.Uid;
        pid = @Model.ProductInfo.Pid;
        isGuestSC = @WorkContext.MallConfig.IsGuestSC;
        scSubmitType = @WorkContext.MallConfig.SCSubmitType;
    </script>
</head>

<body>

<div id="headerBar" class="bigBox">
<div class="box1210">
欢迎访问 @WorkContext.MallConfig.MallName
<div  class="headerLink">
    @if (WorkContext.Uid < 1)
    {
        <a href="@Url.Action("login", "account", new RouteValueDictionary { { "returnUrl", WorkContext.Url } })">[登录]</a>
        <a href="@Url.Action("register", "account")" class="A_b">[注册]</a>
    }
    else
    {
        @:您好: @WorkContext.NickName
        <a href="@Url.Action("logout", "account")">[退出]</a>
        if (WorkContext.PartUserInfo.StoreId > 1)
        {
        <a href="@Url.Action("index", "home", new RouteValueDictionary { { "area", "storeadmin" } })">[店铺管理]</a>
        }
        if (WorkContext.MallAGid > 1)
        {
        <a href="@Url.Action("index", "home", new RouteValueDictionary { { "area", "malladmin" } })">[商城管理]</a>
        }
        <a href="@Url.Action("orderlist", "ucenter")">[我的订单]</a>
    }
</div>
</div> 
</div>


<div id="header" class="bigBox">
<div class="box1210" id="header1">
<a href="#" class="logo left"><img src="@{@WorkContext.ImageCDN}/images/logo.jpg" /></a>
<div class="search left">
<div class="searchCon">
    <input type="text" id="keyword" name="keyword" class="Stext" autocomplete="off" onkeydown="javascript:if(event.keyCode==13) mallSearch(document.getElementById('keyword').value);" value="@WorkContext.SearchWord" />
    <input name="" type="button" value="搜索" class="Sbutton" onclick="mallSearch(document.getElementById('keyword').value)" />
<div class="clear"></div>
</div>

<div class="searchHot">热门搜索：
 @{
     List<AdvertInfo> searchWordAdvertList = Adverts.GetAdvertList(5);
     }
     @Html.Raw(searchWordAdvertList[0].Body)
 </div>

</div>


<div class="shopping right" onmousemove="getCartSnap()" id="cartSnapBox" onmouseout="closeCartSnap(event)">
<h2><a href="@Url.Action("index", "cart")">我的购物车<b id="cartSnapProudctCount">@WorkContext.CartProductCount</b></a></h2>
<div id="cartSnap" class="shoppingList" style=" display:none;"><div class="loding"><img src="@{@WorkContext.ImageCDN}/images/loading.gif" /><br />加载中，请稍候... </div></div>
</div>

<div class="clear"></div>
</div>
</div>

<div id="nav" class="bigBox">
<div class="box1210">
<!-- 分类导航 -->

<div id="categorys" onmouseover="document.getElementById('categorysCon').className=''" onmouseout="document.getElementById('categorysCon').className='hide'">
<h2>全部商品分类</h2>

<div id="categorysCon" class="hide">

@{
    List<NavInfo> navList = Navs.GetNavList();
    }
@{
    int layerFlag = 0;
    foreach (NavInfo info in navList)
    {
        if (info.Layer == 1)
        {
            if (layerFlag == 1)
            {
               @:</div></div>
            }
            @:<div class="item" onmouseover="this.className='item hotItem'" onmouseout="this.className='item'"><h3><a href="javascript:void(0)">@info.Name</a></h3><div class="itmeSon">
            layerFlag = 1;
        }
        else if (info.Layer == 2)
        {
            @:<dl><dt><a style="" href="javascript:void(0)">@info.Name</a></dt><dd>
            foreach (NavInfo nav in navList.FindAll(x => x.Pid == info.Id))
            {
                 @:<em><a style="" href="@nav.Url">@nav.Name</a></em>
            }
            @:</dd><div class="clear"></div></dl>
        }
    }
    @:</div></div>
}

</div>

</div>

<!-- 分类导航结束 -->

<ul id="navItme">
<li><a href="/">首页</a></li>
<li><a href="@Url.Action("category", new RouteValueDictionary { { "cateId", 55 } })">电视专场</a></li>
<li><a href="@Url.Action("category", new RouteValueDictionary { { "cateId", 65 } })">电脑专场</a></li>
<li><a href="@Url.Action("category", new RouteValueDictionary { { "cateId", 71 } })">手机专场</a></li>
</ul>
</div>
</div>

@{
    List<CategoryInfo> categoryList = Categories.GetCategoryList();
    CategoryInfo categoryInfo2 = Categories.GetCategoryById(Model.CategoryInfo.ParentId, categoryList);
    CategoryInfo categoryInfo1 = Categories.GetCategoryById(categoryInfo2.ParentId, categoryList);
    }

<div class="breadcrumb box1210">
<strong><a href="#">@categoryInfo1.Name</a></strong>
<span>&nbsp;&gt;&nbsp;<a href="#">@categoryInfo2.Name</a>&nbsp;&gt;&nbsp;<a href="@Url.Action("category", new RouteValueDictionary { { "cateId", Model.CategoryInfo.CateId } })">@Model.CategoryInfo.Name</a></span></div>


<div id="ConInfo" class="box1210">
<div id="infoL">
<div class="itme">
<h2>商品信息</h2>
<div class="proList proList3">
<ul>
<li>
<a href="@Url.Action("product", new RouteValueDictionary { { "pid", Model.ProductInfo.Pid } })"><img src="@{@WorkContext.ImageCDN}/upload/store/@Model.ProductInfo.StoreId/product/show/thumb190_190/@Model.ProductInfo.ShowImg" width="100%" />
<em>@Model.ProductInfo.Name</em></a>
<div class="i"><p>商城价:</p><b>¥@Model.ProductInfo.ShopPrice</b></div>
<div class="i"><p>商品评分:</p><b><div class="star">
<span class="star_yellow" style=" width:@Html.Raw((Model.ProductInfo.GetStarLevel() * 20).ToString())%;">&nbsp;</span>
</div></b></div>
<div class="i"><p>评价数:</p><span>@Model.ProductInfo.ReviewCount 条</span></div>
<div class="i"><a href="javascript:void(0)" onclick="addProductToCart(@Model.ProductInfo.Pid, 1)" class="redBT">加入购物车</a></div>
</li>
</ul>
</div>
<div class="clear"></div>
</div>
</div>
<div id="infoR">
<div class="infoRCon" id="PJ">

<div class="PJinfo">
<h2>商品评价</h2>
@{
    int reviewLayer1 = 0;
    int reviewLayer2 = 0;
    int reviewLayer3 = 0;
    
    int goodStars = Model.ProductInfo.Star1 + Model.ProductInfo.Star2 + Model.ProductInfo.Star3;
    int allStars = goodStars + Model.ProductInfo.Star4 + Model.ProductInfo.Star5;

    if (allStars != 0)
    {
        reviewLayer1 = (int)Math.Floor((double)(goodStars / allStars * 100));
        reviewLayer2 = (int)Math.Floor((double)(Model.ProductInfo.Star4 / allStars * 100));
        reviewLayer3 = 100 - reviewLayer1 - reviewLayer2;
    }
    }
<div class="rate"> 
<strong>@reviewLayer1<span>%</span></strong> <br>
  <span>好评度</span> 
</div>
  
<div class="percent">
  <dl>
    <dt>好评<span>(@reviewLayer1%)</span></dt>
    <dd>
      <div style="width: @reviewLayer1%;"></div>
    </dd>
  </dl>
  <dl>
    <dt>中评<span>(@reviewLayer2%)</span></dt>
    <dd class="d1">
      <div style="width: @reviewLayer2%;"> </div>
    </dd>
  </dl>
  <dl>
    <dt>差评<span>(@reviewLayer3%)</span></dt>
    <dd class="d1">
      <div style="width: @reviewLayer3%;"> </div>
    </dd>
  </dl>
</div>

<div class="btns">
  <div>您可对已购商品进行评价</div>
  <a href="@Url.Action("orderlist", "ucenter")" class="btn-comment" target="_blank">发表评论</a>
  <div></div>
</div>
<div class="clear"></div>
</div>

<h2 class="infoRT infoBT2">
<ul>
<li @if(Model.ReviewType==0){<text>class="hot"</text>}><a href="@Url.Action("productreviewlist", new RouteValueDictionary { { "pid", Model.ProductInfo.Pid }, { "reviewType", 0 } })">全部评价</a></li>
<li @if(Model.ReviewType==1){<text>class="hot"</text>}><a href="@Url.Action("productreviewlist", new RouteValueDictionary { { "pid", Model.ProductInfo.Pid }, { "reviewType", 1 } })">好评</a></li>
<li @if(Model.ReviewType==2){<text>class="hot"</text>}><a href="@Url.Action("productreviewlist", new RouteValueDictionary { { "pid", Model.ProductInfo.Pid }, { "reviewType", 2 } })">中评</a></li>
<li @if(Model.ReviewType==3){<text>class="hot"</text>}><a href="@Url.Action("productreviewlist", new RouteValueDictionary { { "pid", Model.ProductInfo.Pid }, { "reviewType", 3 } })">差评</a></li>
<div class="clear"></div>
</ul>
</h2>

@foreach (DataRow row in Model.ProductReviewList.Rows)
{
<div class="itme">
  <div class="user">
    @{
    string avatar = row["avatar"].ToString();
    if (string.IsNullOrWhiteSpace(avatar))
    {
      <img src="@{@WorkContext.ImageCDN}/images/user-avatar.gif" width="50" height="50" /> 
    }
    else
    {
      <img src="@{@WorkContext.ImageCDN}/upload/user/thumb50_50/@row["avatar"]" width="50" height="50" /> 
    }
    }
      <div class="userName">@row["nickname"]</div>
      <div class="userLV">@row["title"]</div>
  </div>
<div class="user_i">
    <div class="itmeSJ"></div>
    <div class="user_i_t"><div class="star"><span class="star_yellow" style=" width:@Html.Raw((TypeHelper.ObjectToInt(row["star"]) * 20).ToString())%;">&nbsp;</span></div><i>@row["reviewtime"]</i></div>
    <dl>
      <dt>心得：</dt>
      <dd>@row["message"]</dd>
      <div class="clear"></div>
    </dl>
    <dl>
      <dt>购买时间：</dt>
      <dd>@row["buytime"]</dd>
      <div class="clear"></div>
    </dl>
@*
    <dl>
  <dt>型号：</dt>
  <dd>联通3G双卡版-630</dd>
  <div class="clear"></div>
    </dl>
    *@
</div>
</div>
}

@Html.WebPager(Model.PageModel)

</div>


 </div>
<div class="clear"></div>
</div>


<div id="footer" class="bigBox">
  <div class="box1210">

    @{
        int flag = 1;
        foreach (HelpInfo info in WorkContext.HelpList)
        {
            if (info.Pid != 0)
            {
                if (info.Url.Length == 0)
                {
            <a href="@Url.Action("question", "help", new RouteValueDictionary { { "id", info.Id } })">@info.Title</a>
                }
                else
                {
            <a href="@info.Url">@info.Title</a>
                }
            }
            else
            {
                if (flag != 1)
                {
                @:</div>
            }
            @:<div class="footerBox"><h3>@info.Title</h3>
            flag++;
            }
        }
        if (WorkContext.HelpList.Count > 0)
        {
        @:</div>
    }
    }

  <div class="clear"></div>
  </div>
  <div class="bigBox footerB">
    <div id="footerB">
      <div class="links">
        @foreach (FriendLinkInfo info in WorkContext.FriendLinkList)
        {
        <a href="@info.Url" target="@info.Target" title="@info.Title">@info.Name</a> @:|
        }
      </div>
      <div>北京市公安局朝阳分局备案编号031143485246&nbsp;&nbsp;|&nbsp;&nbsp;京ICP证047722号&nbsp;&nbsp;|&nbsp;&nbsp;<a href="#" target="_blank">互联网药品信息服务资格证编号(京)-经营性-2012-0005</a>&nbsp;&nbsp;|&nbsp;&nbsp;新出发京零&nbsp;字第大145218号<br />石家庄蝶影软件开发有限公司 程序版本 @WorkContext.MallVersion 版权所有 @WorkContext.MallCopyright</div>
      <div><a href="#"><img width="108" height="40" src="@{@WorkContext.ImageCDN}/images/power_jy.gif"></a> <a href="#"><img width="108" height="40" src="@{@WorkContext.ImageCDN}/images/power_kx.gif"></a> <a href="#"><img width="108" height="40" src="@{@WorkContext.ImageCDN}/images/power_wj.png"></a> <a href="#"><img width="112" height="40" src="@{@WorkContext.ImageCDN}/images/power_cx.png"></a></div>
    </div>
  </div>
</div>
@Html.Raw(WorkContext.ExecuteDetail)
@Html.Raw(WorkContext.MallConfig.Script)
</body>
</html>
